<%-- 
    Document   : template
    Created on : Mar 24, 2011, 5:16:47 PM
    Author     : Javier Snaider
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title><bean:message key="welcome.title"/></title>
        <link rel="stylesheet" href="${pageContext.servletContext.contextPath}/css/template_css.css" media="screen"
              type="text/css" />
        <html:base/>
    </head>
    <body>
        <div class="container">
            <div class="header">
                <a href="#"><img src="${pageContext.servletContext.contextPath}/img/grlg.png" alt="Insert_logo" name="Insert_logo" width="180" height="90" id="Insert_logo" style="background: #C6D580; display:block;"></a>
            </div><!-- end .header -->
            <div class="content">
                <div align="right"><html:link page="/views/checkout.jsp">Back</html:link> <html:link page="/views/menu.jsp">Home</html:link>&nbsp;&nbsp;<br/><br/></div>


                <table width="622" height="350" border="0">
                    <tr>
                        <td width="211" rowspan="3"><table width="96%" border="1">
                                <tr>
                                    <td width="52%"><strong>Sub-Total</strong></td>
                                    <td width="48%">
                                        <fmt:formatNumber pattern="$###0.00"> 
                                            ${sale.subTotal}
                                        </fmt:formatNumber>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td><strong>Certificate </strong></td>
                                        <td>
                                        <c:if test="${sale.certificate.denomination!=null}" >
                                            <fmt:formatNumber pattern="$###0.00">
                                                ${-sale.certificate.denomination}
                                            </fmt:formatNumber>
                                        </c:if>
                                        <c:if  test="${sale.certificate.denomination==null}" >
                                            <fmt:formatNumber pattern="$###0.00">
                                                0
                                            </fmt:formatNumber>
                                        </c:if>
                                    </td>
                                </tr>
                                <tr>
                                    <td><strong>Points</strong></td>
                                    <td>                                       
                                        <fmt:formatNumber pattern="$###0.00">
                                            ${-sale.dollarsFromPoints}
                                        </fmt:formatNumber>

                                    </td>
                                </tr>
                                <tr>
                                    <td><strong>New-Subtotal</strong></td>
                                    <td>
                                        <fmt:formatNumber pattern="$###0.00"> 
                                            ${sale.subTotal-sale.certificate.denomination -sale.dollarsFromPoints}
                                        </fmt:formatNumber>
                                    </td>
                                </tr>
                                <tr>
                                    <td><strong>Tax</strong></td>
                                    <td><fmt:formatNumber pattern="$###0.00"> ${sale.tax} </fmt:formatNumber></td>
                                </tr>
                                <tr>
                                    <td><strong>Total</strong></td>
                                    <td><fmt:formatNumber pattern="$###0.00"> ${sale.total} </fmt:formatNumber></td>
                                </tr>
                            </table></td>
                        <td width="395" height="50">
                            <c:if test="${customer.registeredForRewards}" >
                                <html:form  action="/useCertificate" method="post">
                                    <label for="textfield">Certificate Number</label>:
                                    <html:text property="cid"/>
                                    <html:submit value="Use Certificate" />
                                </html:form>
                            </c:if> &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td height="71">
                            <c:if test="${customer.registeredForRewards}" >
                                <html:form  action="/usePoints" method="post">
                                    <label for="textfield">Enter points</label>
                                    (Max: ${sale.customer.pointsAccount.balance}):
                                    <html:text property="points"/>
                                    <html:submit value="Use Points" />
                                </html:form>
                            </c:if>&nbsp;


                        </td>
                    </tr>
                    <tr>
                        <td height="38">&nbsp;</td>
                    </tr>
                    <tr>
                        <td height="66" colspan="2">
                            <html:form action="/finalPayment" method="post">
                                <strong>Payment Options:</strong><br />
                                <html:radio property="paymentOption" value="cash" />
                                <label for="12">Cash</label>
                                <br />
                                <html:radio property="paymentOption"  value="debit" />
                                <label for="1">Debit</label>
                                Card<br />
                                <html:radio property="paymentOption"  value="credit" />
                                <label for="2">Credit</label>
                                Card<br />
                                <label for="3"> Card Number : </label>
                                <html:text property="cardNumber" styleId="3" />
                                <br/><br/>
                                <html:submit value="Pay Now" />
                            </html:form>

                        </td>
                    </tr>
                </table>
            </div><!-- end .content -->
        </div><!-- end .container -->
        <div class="footer">
            <p>Copyright 2011&nbsp;TigerSoft</p>
        </div><!-- end .footer -->
    </body>
</html>
